package com.lingshi.shopping_cart_service.listener;


import com.lingshi.common.constant.Const;
import com.lingshi.common.entity.Goods;
import com.lingshi.common.service.ICartService;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
@RocketMQMessageListener(consumerGroup = Const.DEL_CART_GROUP,topic = Const.DEL_CART_QUEUE)
public class DelCartListener implements RocketMQListener<Long> {

    @Autowired
    private ICartService cartService;


    @Override
    public void onMessage(Long goodsId) {
        cartService.deleteCartOption(goodsId);
    }
}
